<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // let x = function(){
        //     console.log("test01...")
        // }
        function x(){
            console.log("test01...")
        }
        var x;
        console.log(x);
        x = 10
        console.log(x);

        console.log(test01);//f->test01()

        //全局变量
        var x = 100;

        function test01(){
            //var x;//进行了一次变量提升
            console.log("t1:"+x);//undefined
            //局部变量 - 不能跨函数访问的

            //x = 200
            var x = 200;
            console.log("t2:"+x);//200
        }
        test01();//函数的调用
        console.log("x:"+x);//100

        // let z = 1;
        function z(){};
        // var z = 10;

        let xx = 10;
        function test02(){
            let xx;
            xx = 20;
            console.log("xx",xx);
        }
        test02();
        console.log("xx",xx);
    </script>
</body>
</html>